﻿@model List<SnongPhoneShop.Models.SanPham>
@{
    if (ViewBag.Loai_DM == 1)
    {
        ViewBag.Title = "Danh mục điện thoại " + ViewBag.Ten_DM;
    }
    else
    {
        ViewBag.Title = ViewBag.Ten_DM;
    }    
    Layout = "~/Views/Shared/_LayoutMetroUI.cshtml";
    ViewBag.CurrPage = "Danh mục " + ViewBag.Ten_DM;
}

<div class="group-tiles">
    <div class="column">
        <div class="large-tiles tiles">
            <div class="amazingslider-2" style="display:block;position:relative;margin:0 auto 32px;">
                <ul class="amazingslider-slides" style="display:none;">
                    @foreach (var Item in Model) { 
                        <li><img src="@Item.AnhDaiDien" alt="@Item.TenSanPham" /></li>
                    }
                </ul>
            </div>
        </div>
        <div class="medium-tiles tiles"></div>
        <div class="medium-tiles tiles"></div>
    </div>
    @for (int i = 0; i < Model.Count; i++) {
        if (i % 3 == 0) { 
            @Html.Raw("<div class=\"column\">")
        }
        <div class="wide-tiles tiles">
            <span class="title-tiles">@Model[i].TenSanPham</span>
            <img class="img-product" src="@Model[i].AnhDaiDien" />
            <div class="basic-info">
                <ul>
                    <li>Tình trạng: @Model[i].TinhTrang.TenTinhTrang</li>
                    <li>Bảo hành: @Model[i].BaoHanh</li>
                    <li>Quà tặng: @Model[i].QuaTang</li>
                    <li>Giá bán: @Model[i].DonGia.ToString("n0") VNĐ</li>
                </ul>
            </div>
            <div class="wide-tiles tiles-hover">
                <a href="@Url.Action("CT_SanPham", "San_Pham", new { ID = Model[i].MaSanPham.Trim() })"><img class="detail-view" src="/Images/ImgPage/2c_info.png" title="Xem chi tiết" /></a>
                <a href="@Url.Action("Dat_Hang", "San_Pham", new { ID = Model[i].MaSanPham.Trim() })"><img class="add-cart" src="/Images/ImgPage/Very-Basic-Plus-icon.png" title="Thêm giỏ hàng" /></a>
            </div>
        </div>
        if (i % 3 == 2 || i == Model.Count - 1) { 
            @Html.Raw("</div>")
        }
    }
</div>


